Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 2 - Geometric Shapes / Geometric Shapes Reference
Functions


Editing Shape Geometries

The functions described in the previous section, "Getting and Setting Shape Geometries," allow you to examine and replace entire shape geometries. The functions in this section provide more sophisticated abilities--with these functions, you can examine and edit specific parts of geometries.

For example, the GXCountShapeContours function allows you to determine the number of contours in a shape's geometry. For polygon and path shapes, this number is an integral part of the geometry--it is the first value stored in the geometry; for other geometric shapes, this function simply returns 1.

Similarly, the GXCountShapePoints function returns the number of geometric points in a specified contour of a shape's geometry.

The GXGetShapeIndex function returns the geometry index of a specific geometric point given a contour number and the index of the geometric point within the contour. (Remember, each geometric point in a geometry has an geometry index--if you consider a geometry as a list of geometric points starting from the first geometric point of the first contour to the last geometric point of the last contour, the geometry index of a particular geometric point is its position in this list.) You use geometry indexes to specify ranges of geometric points in many of the functions in this section.

You can use the GXGetShapePoints function to obtain a copy of a particular range of geometric points from a shape's geometry, and you can use the GXSetShapePoints to replace a particular range of geometric points in a shape's geometry.

You can use the GXGetPolygonParts function to extract a range of geometric points from an existing polygon shape and put them into a new polygon geometry. You can use the GXSetPolygonParts function to replace any range of geometric points in an existing polygon shape with any new polygon geometry.

Similarly, you can use the GetPathsParts function to extract a range of geometric points from an existing path shape and put them into a new path geometry, and you can use the SetPathsParts function to replace any range of geometric points in an existing path shape with any new path geometry.

The GXGetShapeParts and GXSetShapeParts functions allow the broadest editing control. With the GXGetShapeParts function, you can extract any range of geometric points from an existing shape and put them into a new shape. With the GXSetShapeParts function, you can replace any range of geometric points in an existing shape with the entire geometry of another shape.

You can apply GXCountShapeContours, GXCountShapePoints, GXGetShapeIndex, GXGetShapePoints, GXSetShapePoints, GXGetShapeParts, and GXSetShapeParts functions to other shape types as well as geometric shapes. Information about how they work for geometric shapes is presented in this section. You can find more information about these functions in Chapter 5, "Bitmap Shapes," and Chapter 6, "Picture Shapes," and in Inside Macintosh: QuickDraw GX Typography.


Subtopics
GXCountShapeContours
GXCountShapePoints
GXGetShapeIndex
GXGetShapePoints
GXSetShapePoints
GXGetPolygonParts
GXSetPolygonParts
GXGetPathParts
GXSetPathParts
GXGetShapeParts
GXSetShapeParts

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help